package com.jrx.anytxn.investor.timer.job.fundRoute.step;

import com.jrx.anytxn.investor.bean.InvestorFundRouteBean;
import com.jrx.anytxn.investor.entity.TlFundRouteLog;
import com.jrx.anytxn.investor.handler.IInvestorLoanRouteHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 资金源路由 - processor
 *
 * @author liuyang
 * @date 2020-06-04
 */
@Service
public class InvestorFundRouteProcessor implements ItemProcessor<TlFundRouteLog, InvestorFundRouteBean> {

    Logger logger = LoggerFactory.getLogger(InvestorFundRouteProcessor.class);

    @Autowired
    private IInvestorLoanRouteHandler investorLoanRouteHandler;

    /**
     * 资金源路由处理
     *
     * @param fundRouteLog 放款资金源路由记录
     * @return InvestorFundRouteBean 联合贷放款路由bean
     * @throws Exception
     * @author liuyang
     * @date 2020-06-04
     */
    @Override
    public InvestorFundRouteBean process(TlFundRouteLog fundRouteLog) throws Exception {
        return investorLoanRouteHandler.fundRoute(fundRouteLog);
    }
}
